package com.go.dds.service;

import com.go.core.bean.DdsScore;
import com.go.core.bean.JumpingScore;
import com.go.core.repo.DdsScoreRepo;
import com.go.core.repo.JumpingScoreRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ddsService")
public class DdsService {
    @Autowired
    DdsScoreRepo ddsScoreRepo;

    // 保存玩家信息
    public DdsScore save(DdsScore player){
        return ddsScoreRepo.save(player);
    }

    public DdsScore findPlayerByUUID(String uuid){
        return ddsScoreRepo.findByUUID(uuid);
    }

    // 记录玩家分数
    public int updateScoreByUUID(String uuid, int score){
        return ddsScoreRepo.updateScoreByUUID(uuid, score);
    }

    // 获取排行榜
    public List<DdsScore> getScoreBorad(){
        return ddsScoreRepo.getScoreBorad();
    }
}
